﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrackDataResumenByClients.aspx.cs" Inherits="GPSTrackingWebsiteManager.Manager.Pages.TrackDataResumenByClients" %>

<!DOCTYPE html>

<link href="../../Css/GPSTrackingWebsite.css" rel="stylesheet" />
<link href="../../Css/messi.css" rel="stylesheet" />
<script src="../../Javascript/jquery-1.11.1.min.js"></script>
<script src="../../Javascript/messi.js"></script>
<script src="../../Javascript/Custom.js"></script>
<script src="../../Javascript/WindowMessageManager.js"></script>

<html xmlns="http://www.w3.org/1999/xhtml">

<telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
    <script type="text/javascript">
        function resizeGrid() {
            var tableView = $find("<%=ClientsControlGrid.ClientID %>");
            tableView.get_element().style.height = (window.innerHeight - 125) + "px";

            document.getElementById('HiddenFieldHeight').value = (window.innerHeight);
        }

        //Windows Message Manager 
        var objWindowsMessageManager = new WindowsMessageManager();

    </script>
</telerik:RadScriptBlock>

<head runat="server">
    <title>Resumen Clientes</title>
</head>
<body onresize="resizeGrid()" style="overflow: hidden">
    <form id="form1" runat="server">
    <div>
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>        
        <asp:HiddenField ID="HiddenFieldHeight" runat="server" Value="323" />
        <asp:HiddenField ID="HiddenFieldError" runat="server" Value="" />
            <fieldset>
                <legend>Resumen Clientes</legend>
                <table style="width: 100%; text-align: left">
					<tr>
                        <td>
                            <fieldset>
                                <legend>Seleccione las fechas a Consultar</legend>
                                <telerik:RadDatePicker ID="beginDateSelected" runat="server" DateInput-Label="Fecha Desde" style="text-align: left" Height="24px" Width="200px" Calendar-CultureInfo="es-CR">
							        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
			                        <DateInput DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy"  Height="24px" LabelWidth="50%"></DateInput>
		                        </telerik:RadDatePicker>

                                <telerik:RadDatePicker ID="endDateSelected" runat="server" DateInput-Label="Fecha Hasta" style="text-align: left" Height="24px" Width="200px" Calendar-CultureInfo="es-CR">
							        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
			                        <DateInput DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy" Height="24px" LabelWidth="50%"></DateInput>
		                        </telerik:RadDatePicker>
                                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                                <telerik:RadButton ID="btnVPCProcessSearch" runat="server" Text="Buscador" Height="32px" Width="32px" AutoPostBack="true" ToolTip="Consultar Datos" OnClick="btnVPCProcessSearch_Click">
                                    <Image ImageUrl="../../Template/Icons/32px/Actions-document-find-icon.png" />
                                </telerik:RadButton>
                            </fieldset>                      
                        </td>
                    </tr>

                    </table>
                    </fieldset>

                   
								<telerik:RadGrid ID="ClientsControlGrid" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Height="100%" AllowMultiRowSelection="true" OnNeedDataSource="ClientsControlGrid_NeedDataSource" AllowSorting="true" GroupingSettings-CaseSensitive="false">
		                            <MasterTableView EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true" EditFormSettings-CaptionFormatString="Modo Edición" CommandItemDisplay="TopAndBottom" NoMasterRecordsText="No hay registros" AllowFilteringByColumn="true" TableLayout="Auto">
                                    <CommandItemTemplate>
                                        <div style="padding: 5px 5px;"> Resumen de Clientes Visitados: 
                                                <asp:LinkButton ID="lbClearFilters" runat="server" OnClick="lbClearFilters_Click"  Visible='<%# !ClientsControlGrid.MasterTableView.IsItemInserted %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/mixx-icon.png"/>Limpiar Filtros</asp:LinkButton>                                                                               
				                                <asp:LinkButton ID="lbShowError" runat="server" OnClick="lbShowError_Click" Visible='<%# HiddenFieldError.Value == string.Empty ? false : true %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/bug-icon.png"/>Error Técnico</asp:LinkButton>                                                                                                               
                                        </div>                        
                                    </CommandItemTemplate>

                                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>

                                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>

                                        <Columns>
                                            <telerik:GridClientSelectColumn DataType="System.Boolean" FilterControlAltText="Filter Selected column" UniqueName="Selected" ItemStyle-Width="40px" HeaderStyle-Width="40px">
                                            </telerik:GridClientSelectColumn>
                                            <telerik:GridBoundColumn DataField="GPSImei" HeaderText="GPSImei" UniqueName="GPSImei" HeaderStyle-Width="120px" FilterControlWidth="100px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="GPSName" HeaderText="Nombre del dispositivo" UniqueName="GPSName" HeaderStyle-Width="160px" FilterControlWidth="140px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="ClientID" FilterControlAltText="Filter Description column" HeaderText="Cliente ID" Display="false" HeaderStyle-Width="100px" FilterControlWidth="80px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
											</telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="ClientName" FilterControlAltText="Filter Description column" HeaderText="Nombre Cliente" HeaderStyle-Width="160px" FilterControlWidth="140px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
											</telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="DateTimeBegin" FilterControlAltText="Filter Description column" HeaderText="Fecha Llegada" HeaderStyle-Width="140px" FilterControlWidth="120px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
											</telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="DateTimeEnd" FilterControlAltText="Filter Description column" HeaderText="Fecha Partida " HeaderStyle-Width="140px" FilterControlWidth="120px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
											</telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Hours" FilterControlAltText="Filter Description column" HeaderText="Horas Visita" HeaderStyle-Width="80px" FilterControlWidth="60px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
											</telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Minutes" FilterControlAltText="Filter Description column" HeaderText="Minutos Visita" HeaderStyle-Width="90px" FilterControlWidth="70px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
											</telerik:GridBoundColumn>
                                        </Columns>

                                        <EditFormSettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                                        </EditFormSettings>

                                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                                    </MasterTableView>
                                      <ClientSettings EnableRowHoverStyle="true">
                                            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                                            </Scrolling>  <Selecting AllowRowSelect="True"></Selecting><ClientEvents OnPopUpShowing="PopUpShowing" />
                                      </ClientSettings>
                                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

                                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                                </telerik:RadGrid> 
					




    </div>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>

        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="btnVPCProcessExecution">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ClientsControlGrid" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="tbVPCProcessClear">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ClientsControlGrid" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass=""  />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnVPCProcessSearch">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ClientsControlGrid" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ClientsControlGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ClientsControlGrid" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>

    </form>
</body>
</html>
